package com.nursinghome;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import com.nursinghome.admin.mapper.UserMapper;
import com.nursinghome.bean.User;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class UserTest01 {
    @Autowired
    private UserMapper userMapper;
    @Test
    public void test01() {
        Snowflake snowflake = IdUtil.getSnowflake(1, 1);
        String id = snowflake.nextIdStr();
        System.out.println("id" + id);

    }
    @Test
    public void test02() {
        User user = new User(null, "shuoshuo123", "shuohsuo123", 2);
        System.out.println(userMapper.insertUser(user));

    }
    @Test
    public void test03() {
        User user = new User(null, "shuoshuo123", "shuo123", 2);
        System.out.println(userMapper.updateByUse(user));

    }
}
